package com.example.zhu.controller;

import com.example.zhu.entity.Admin;
import com.example.zhu.result.Result;
import com.example.zhu.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin")
@CrossOrigin
public class AdminController {
    @Autowired
    private LoginService loginService;

    /**
     * 登录
     * @param admin
     * @return
     */
    @PostMapping("/login")
    private Result login(@RequestBody Admin admin){
        return loginService.login(admin);
    }

}
